import * as Utils from 'utils.js'
/*速云系统设置、权限设置的api*/


/*验证系统设置权限设置密码*/
export function Gain_AdminPassword(arr, callBack) {
	let url = Utils.getPostIp("/api/Gain_AdminPassword");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "GET", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

/**修改系统设置权限设置密码**/
export function Update_AdminPassword(arr, callBack) {
	let url = Utils.getPostIp("/api/Update_AdminPassword");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

/** 

获取系统设置信息

**/

export function Select_SystemSetup(arr, callBack) {
	let url = Utils.getPostIp("/api/Select_SystemSetup");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "GET", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}
/** 

删除全部权限

**/

export function Delete_All_UserRoot(arr, callBack) {
	let url = Utils.getPostIp("/api/Delete_All_UserRoot");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

/** 

保存系统设置信息  单击开启状态时调用

**/

export function Save_SystemSetup(arr, callBack) {
	let url = Utils.getPostIp("/api/Save_SystemSetup");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

/** 

权限设置:  获取用户

**/

export function Gain_User(arr, callBack) {
	let url = Utils.getPostIp("/api/Gain_User");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

/** 

权限设置:  更改用户状态（单击的时候调用）

**/

export function Update_UserState(arr, callBack) {
	let url = Utils.getPostIp("/api/Update_UserState");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

/** 

权限设置:  获取当前用户的权限

**/

export function Gain_AllUsersRoot(arr, callBack) {
	let url = Utils.getPostIp("/api/Gain_AllUsersRoot");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

//提示框
export  function showTip(msg) {
	uni.showToast({
		icon: 'none',
		position: 'bottom',
		title: msg,
		style:"z-index:9999"
	});
};
//确认框
export  function showConfirm(msg,sureClick){
	uni.showModal({
	    title: '提示',
	    content: msg,
	    success: function (res) {
	        if (res.confirm) {
	            sureClick(true);
	        } else if (res.cancel) {
	            sureClick(false);
	        }
	    }
	});
}

/** 
权限设置: 保存单据权限接口Save_BillRoot
**/

export function Save_BillRoot(arr, callBack) {
	let url = Utils.getPostIp("/api/Save_BillRoot");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}
/** 
权限设置: 保存开单单价权限接口Save_BillPriceRoot
**/

export function Save_BillPriceRoot(arr, callBack) {
	let url = Utils.getPostIp("/api/Save_BillPriceRoot");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}


/** 
权限设置: 保存功能权限接口Save_BillPriceRoot
**/

export function Save_ModuleRoot(arr, callBack) {
	let url = Utils.getPostIp("/api/Save_ModuleRoot");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}


/** 
签到定位: 保存功能接口Add_GPSMessage
**/

export function Add_GPSMessage(arr, callBack) {
	let url = Utils.getPostIp("/api/Add_GPSMessage");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}


/** 
获取默认设置内容 Get_Set_Default
**/

export function Get_Set_Default(arr, callBack) {
	let url = Utils.getPostIp("/api/Get_Set_Default");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "GET", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

/** 
保存默认设置内容 Get_Set_Default
**/

export function Save_Set_Default(arr, callBack) {
	let url = Utils.getPostIp("/api/Save_Set_Default");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}


/** 
获取单据类型 Select_BillType
**/

export function Select_BillType(arr, callBack) {
	let url = Utils.getPostIp("/api/Select_BillType");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "GET", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

/** 
增加和修改页头打印内容 Select_BillType
**/

export function Save_MasterPrintFormat(arr, callBack) {
	let url = Utils.getPostIp("/api/Save_MasterPrintFormat");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

/** 
增加和修改商品明细打印内容 Save_SlavePrintFormat 
**/

export function Save_SlavePrintFormat(arr, callBack) {
	let url = Utils.getPostIp("/api/Save_SlavePrintFormat");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}


/** 
增加和修改页尾打印内容 Save_TableFootPrintFormat 
**/

export function Save_TableFootPrintFormat(arr, callBack) {
	let url = Utils.getPostIp("/api/Save_TableFootPrintFormat");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}


/** 
增加和修改页尾打印内容 Save_TableFootPrintFormat 
**/

export function Select_MasterPrintFormat(arr, callBack) {
	let url = Utils.getPostIp("/api/Select_MasterPrintFormat");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "GET", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

/** 
增加和修改页尾打印内容 Save_TableFootPrintFormat 
**/

export function Select_SlavePrintFormat(arr, callBack) {
	let url = Utils.getPostIp("/api/Select_SlavePrintFormat");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "GET", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

/** 
增加和修改页尾打印内容 Save_TableFootPrintFormat 
**/

export function Select_TableFootPrintFormat(arr, callBack) {
	let url = Utils.getPostIp("/api/Select_TableFootPrintFormat");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "GET", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}




